<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/templates/HeaderTopMenuTemplate.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:define name="conteudo">
        <p:panel id="pnlResultadoPesquisa" header="Reservas Agendadas">
            <p:dataTable id="dtlResultadoPesquisa" 
                         value="#{emprestimoExclusaoForm.getEmprestimosAgendados()}"
                         var="emp">


                <p:column headerText="Livro">
                    <h:outputText value="#{emp.livro.titulo}"/>
                </p:column>
                <p:column headerText="ISBN">
                    <h:outputText value="#{emp.livro.isbn}"/>
                </p:column>
                <p:column headerText="Aluno com Livro">
                    <h:outputText value="#{emp.aluno.nome}"/>
                </p:column>
                <p:column headerText="Matrícula Aluno">
                    <h:outputText value="#{emp.aluno.matricula}"/>
                </p:column>
                <p:column headerText="Dt. Reserva">
                    <h:outputText value="#{emp.dtEmprestimo}">
                        <f:convertDateTime pattern="dd/MM/yyyy"/>
                    </h:outputText>
                </p:column>
                <p:column headerText="Dt. Devolução">
                    <h:outputText value="#{emp.dtDevolucao}">
                        <f:convertDateTime pattern="dd/MM/yyyy"/>
                    </h:outputText>
                </p:column>
                <p:column headerText="Excluir" width="10%">
                     <h:commandLink actionListener="#{emprestimoExclusaoForm.onBotaoOKClick()}" onclick="alert('Confirma exclusão de reserva?')">
                        <p:graphicImage library="images" name="ico_del.png"/>
                    </h:commandLink>
                </p:column>
            </p:dataTable>
             <h:panelGrid columns="2">
                  <p:commandButton id="btnCancelar" value="Voltar" immediate="true" action="/livroConsultaForm.xhtml?faces-redirect=true"  icon="ui-icon-cancel" />
            </h:panelGrid>
        </p:panel>
        

    </ui:define>

</ui:composition>
